/**
 *  会员专区
 */
define(function(require,exports,module) {
    var myPub = require('./public');

    // var oSignedBtn = $('.js_signedBtn');
    var off_tap = true;
    var off_tap_time = null;
    var slayer_black = 'background-color:rgba(0,0,0,0.5); color:#ffffff; border:none; border-radius: 5px; min-width:50%';
    var oChoujiang = $('.js_choujiang');
    var oBigMember = $('.js_bigMember');

    // var signInValue = $('#signInValue').val();

    // var oCountIntegral = $('.js_countIntegral');    // 积分数字

    var oMemberVipArea = $('.js_memberviparea');                        // 会员专享区域
    var lazLoading = new myPub.lazLoadingImg();
    var oStepGreen = $('.js_stepGreen');                                // 会员等级绿条
    var oStepPercent = $('.js_stepPercent');                            // 显示的积分
    var nCurrentIntegral = $('.js_currentPoint').text()*1;              // 当前积分点数
    var nAllPoint = $('.js_allPoint').text()*1;                         // 当前级别总的积分点数

    //轮播
    var mySwiper = new Swiper('.js_memberRightZone',{
        freeMode : true,
        freeModeMomentumRatio: 0.5,
        observer: true,
        observeParents: true,
        slidesPerView : 'auto',
        lazyLoading: true,
        watchSlidesProgress: true,
        watchSlidesVisibility : true
    })


    // 会员进度条
    if(nCurrentIntegral >= 6000){
        oStepGreen.css({'width' : '100%'});
        oStepPercent.css({'left' :'100%'});
    }else{
        oStepGreen.css({'width' : nCurrentIntegral/nAllPoint*100+'%'});
        oStepPercent.css({'left' : nCurrentIntegral/nAllPoint*100+'%'});
    }


    /*if(signInValue != null || signInValue != 0){
        var signed_info = '签到成功 +'+signInValue;
    }else{
        var signed_info = '签到成功 +10';
    }*/
    oChoujiang.click(function () {
        myPub.TipLayer('敬请期待！',slayer_black);
    });
    oBigMember.click(function () {
        myPub.TipLayer('敬请期待！',slayer_black);
    });
   /* oSignedBtn.hammer().on('tap', function () {

        if(off_tap) {
            // off_tap = false;
            if(oSignedBtn.hasClass('active')) {
                // oSignedBtn.removeClass('active');
                off_tap = false;
            }
            else  {
                // 签到成功
                G_JSON_POST("/myInfo/signIn",{},function (data) {
                    if(data.status == 'success'){
                        oSignedBtn.addClass('active');
                        myPub.TipLayer_noShade(signed_info, slayer_black);
                        var oldIntegral = parseInt(oCountIntegral.text());
                        oCountIntegral.text(oldIntegral + parseInt(signInValue) );
                    }else{

                    }
                });

            }

            // 阻止多次点击
            clearTimeout(off_tap_time);
            off_tap_time = setTimeout(function () {
                off_tap = true;
            },800)

        }

    })*/

    // 懒加载
    lazLoading.DestroyLazLoadingImg();
    // lazLoading.AddLazLoadingImg(oGoodsList[index]);
    lazLoading.AddLazLoadingImg($('.js_contian')[0]);
    // 跳转app
    myPub.JudgeAppHref(oMemberVipArea.find('a'));
});